/*
 * FileIO.h
 *
 *  Created on: 2010-3-1
 *      Author: liangjin
 */

#ifndef __FILEIO_H_
#define __FILEIO_H_

#include "DataIO.h"
#include <stdio.h>


class FileIO :public MDataIO
{
public:
	FileIO (FILE* aFile)
	{
		iFile=aFile;
	}
	
	size_t ReadBytes(void* buffer,const size_t count)
	{
		return fread(buffer,1,count,iFile);
	}
	~FileIO()
	{
		fclose(iFile);
	}

	int SkipBytes(const long count)
	{
		if (count < 1)
		{
			return 0;
		}
		return fseek(iFile,count,SEEK_CUR);
	}


	
private:
	FILE* iFile;
};

#endif /* FILEIO_H_ */
